module key_process
#(parameter T =20000)
 (

    input   wire                clk         ,
    input   wire                rst_n       ,    
    input   wire                key_switch  ,   
    output  wire                flag_switch    
);

    wire                        wave_switch;
    
    // 不规则波形消除抖动
    
    key_filter 
    #(.T(T))
    key_filter_switch(
    
                .clk                (clk),
                .rst_n              (rst_n),
                
                .key                (key_switch),
                
                .key_wave           (wave_switch)
            );
 
    // 边沿检测
 
    check_edge check_edge_switch(

                .clk                (clk),
                
                .wave               (wave_switch),
                
                .flag_pos           (),
                .flag_neg           (flag_switch)
            );  

endmodule 